package com.tuxing.draa_data.pojo.subject;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 
 * </p>
 *
 * @author yuanshihang
 * @since 2021-12-15
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("new_dc_wos_sub_attr")
public class NewDcWosSubAttr implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "ID",type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 元数据记录号
     */
    @TableField(value = "RECORD_ID")
    private Long recordId;

    /**
     * 属性值
     */
    @TableField("SUB_ID")
    private Long subId;

    /**
     * 年份
     */
    @TableField("YEAR")
    private Integer year;

    /**
     * 备注
     */
    @TableField("REMARK")
    private String remark;

    /**
     * 创建人
     */
    @TableField("CREATE_BY")
    private Integer createdBy;

    /**
     * 创建时间
     */
    @TableField("CREATE_DATE")
    private LocalDateTime createdTime;

    /**
     * 更新人
     */
    @TableField("UPDATE_BY")
    private Integer updatedBy;

    /**
     * 更新时间
     */
    @TableField("UPDATE_DATE")
    private LocalDateTime updatedTime;

    public void create(Long recordId, Long subId, Integer year, String remark) {
        this.recordId = recordId;
        this.subId = subId;
        this.year = year;
        this.remark = remark;
        this.createdBy = -1;
        this.createdTime = LocalDateTime.now();
        this.updatedBy = -1;
        this.updatedTime = LocalDateTime.now();
    }
}
